//+-----------+ //| TwoPerBar | //+-----------+ #property copyright "Ron Thompson" #property link "http://www.lightpatch.com/forex/" #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 DodgerBlue #property indicator_color2 Magenta extern double BDistance = 14; // plus how much extern int BPeriod = 15; // Bollinger period extern int Deviation = 2; // Bollinger deviation //---- buffers double val1[]; double val2[]; //+----------------+ //| Custom DE-init | //+----------------+ // Called ONCE when EA is removed from chart int deinit() { int i; string o; //remove the old objects for(i=0; i=0; i--) { bup=iBands(Symbol(),0,BPeriod,Deviation,0,PRICE_OPEN,MODE_UPPER,i); bdn=iBands(Symbol(),0,BPeriod,Deviation,0,PRICE_OPEN,MODE_LOWER,i); if( High[i]>=bup+(14*Point) ) { val2[i]=bup+(15*Point); //ObjectDelete ("myx"+DoubleToStr(objtick,0)); //ObjectCreate ("myx"+DoubleToStr(objtick,0), OBJ_TEXT, 0, Time[i], High[i]+(7*Point)); //ObjectSetText("myx"+DoubleToStr(objtick,0),"X",15,"Arial",Red); //objtick++; } if( Low[i]<=bdn-(14*Point) ) { val1[i]=bdn-(15*Point); //ObjectDelete ("myx"+DoubleToStr(objtick,0)); //ObjectCreate ("myx"+DoubleToStr(objtick,0), OBJ_TEXT, 0, Time[i], High[i]+(7*Point)); //ObjectSetText("myx"+DoubleToStr(objtick,0),"X",15,"Arial",Red); //objtick++; } }//for //Comment(DoubleToStr(mybars,0)+" bars with usable ="+DoubleToStr(objtick,0)+" and unusable="+DoubleToStr(noobj,0)+" maxTR="+DoubleToStr(maxTR,4)); }//start